<% prefix = prefix + "[item_attribute_values_attributes][" + item_attributes_counter.to_s + "]" %>
<% fields_for prefix, item_attributes do |val| %>
	<% att_set_map = attribute_map[item_attributes_counter] %>
	<% inside_prefix = prefix #+ "["+item_attributes_counter.to_s+"]" %>
	<% if att_set_map and (att_set_map[:mutually_exclusive] or att_set_map[:first]) %>
		<div class="<%= row_class %>">
			<div class="left">
				<%= label_tag att_set_map[:name] %>
				<% if att_set_map[:required] %>
					<span class="required">required</span>
				<% else %>
					<span class="optional">(optional)</span>
				<% end %>
				<p><%= att_set_map[:description] %></p>
			</div>
			<div class="right">
				<div class="single">
	<% end %>
					<% if att_set_map and att_set_map[:mutually_exclusive] %>
						<!--
						<select name="<%= inside_prefix + "[item_attribute_id]" %>" id="<%= inside_prefix + "[item_attribute_id]" %>">
							<option value="">Please select</option>
							<% att_set_map[:item_attributes].each do |ia| %>
								<option value="<%= ia[:id] %>"><%= ia[:display_text] %></option>
							<% end %>
						</select>
						-->
						<% collection = att_set_map[:item_attributes] %>
						<%= val.collection_select :item_attribute_id, collection, :id, :display_text, :prompt => :true %>
					<% elsif att_set_map %>
						<%= val.check_box :item_attribute_id, {}, att_set_map[:item_attribute][:id] %>
						<%= val.label att_set_map[:item_attribute][:display_text] %><br />
					<% end %>
	<% if att_set_map and (att_set_map[:mutually_exclusive] or att_set_map[:last]) %>
				</div>
			</div>
		</div>
	<% end %>
<% end %>